<template>
  <div>

    <Markdown v-model="count" :width="800" :height="400" @on-paste-image="onPasteImage" @on-ready="onReady"
      @on-copy="onCopy" @on-save="onSave" theme="light" />

    <el-button @click="print">打印当前文本</el-button>
    <el-button @click="save">替换</el-button>
  </div>
</template>

<script>
import Markdown from 'vue-meditor'
export default {
  name: "markdownTest",
  data () {
    return {
      count2: `*hgjgjg*`,
      count: '测试预览'
    }
  },
  components: {
    Markdown
  },
  methods: {
    print () {
      console.log(this.count);
    },
    save () {
      console.log(this.count = this.count2);
    },

    onReady (data) {
      console.log(data)
    },
    onCopy (text) {
      console.log(text)
    },
    onPasteImage (file) {
      console.log(file)
    },
    onSave (data) {
      console.log(data)
    },
  }
}
</script>

<style scoped>

</style>
